	// Dialog 对话框
	var Dialog=function(selector){
		this.element=$(selector).get(0)
		if(this.element!=null){
			this.init();
		}
	}
	Dialog.prototype=new Control();
	Dialog.prototype.create=function(){
		var html="<section class=\"ht-dialogContent\" id=\"noticeDialog\"><div class=\"wrapper\"><h4 class=\"title\">提示标题</h4><a class=\"ht-CloseButton\">close</a<div class=\"content\"><p>提示标题</p></div></div></section>"
		var element=$(html);
		return element;
	}
	Dialog.prototype.init=function(){
		var title=this.getTitle()
		var self=this;
		$(this.element).removeClass("ht-dialogContent")
		$(this.element).addClass("ht-Dialog")
		
		if(title!=""){
			//this.element.className="dialog close"
			$(this.element).addClass("close")
			setTimeout(function(){self.open()} ,50)
			//setTimeout(function(){self.close()} ,5000)
		}else{
			this.element.style.display="none"
		}
		$(".ht-CloseButton",this.element).bind("click",function(event){self.closeButtonClickHandle(event);})
		//$("form").bind("click",function(event){self.closeButtonClickHandle(event);})
	}
	Dialog.prototype.closeButtonClickHandle=function(event){
		this.close();
	}
	
	Dialog.prototype.getTitle=function(){
		var title=""
		try{
			title=this.element.children[0].children[0].innerHTML
		}catch(error){
			console.log("no title element")
		}
		return title;
	}
	Dialog.prototype.open=function(){
		//alert("open");
		//this.element.className="dialog open"
		$(this.element).removeClass("close")
		$(this.element).addClass("open")
		this.element.style.display="block"
		//$(this.element).animate({opacity:'100'},500);
		return this;
	}
	Dialog.prototype.close=function(){
		//alert("close");
		//this.element.className="dialog close"
		$(this.element).removeClass("open")
		$(this.element).addClass("close")
		var self=this;
		$(this.element).stop()
		setTimeout(function(){
			self.element.style.display="none"
		} ,500)
		/*$(this.element).animate({opacity:'0'},500,function(){
			self.element.style.display="none"
			//$(self.element).hide()
		});*/
		return this;
	}
	HTMLTurbo.control.Dialog=Dialog;